package com.cloudcc.mobile.util;

import java.util.Comparator;

import com.cloudcc.mobile.entity.CoworkerEntity;

/**
 * 
 * @author xiaanming
 *
 */
public class PinyinComparator implements Comparator<CoworkerEntity>{

//	public int compare(ContactEntity o1, ContactEntity o2) {
//		if (o1.getSortLetters().equals("@")
//				|| o2.getSortLetters().equals("#")) {
//			return -1;
//		} else if (o1.getSortLetters().equals("#")
//				|| o2.getSortLetters().equals("@")) {
//			return 1;
//		} else {
//			return o1.getSortLetters().compareTo(o2.getSortLetters());
//		}
//	}
//	public int compare(SortModel o1, SortModel o2) {
//		String str1 = PinyinUtils.getPingYin(((Contacts) o1).getPy());
//		String str2 = PinyinUtils.getPingYin(((Contacts) o2).getPy());
//		return str1.compareTo(str2);
//	}

	@Override
	public int compare(CoworkerEntity o1, CoworkerEntity o2) {
		String str1 = PinyinUtils.getPingYin((o2.getSortLetters()));
		String str2 = PinyinUtils.getPingYin((o1.getSortLetters()));
		return str1.compareTo(str2);
	}

}
